import request from '@/utils/request'

// 获取经纪列表
export function getAgentList(params) {
  return request({
    url: '/agents',
    params
  })
}

// 获取经纪数量
export function getAgentNum(params) {
  return request({
    url: '/agents/count',
    params
  })
}

// 新增经纪
export function addAgent(data) {
  return request({
    url: '/agents',
    method: 'post',
    data
  })
}

// 编辑经纪
export function editAgent(data) {
  return request({
    url: '/agents/' + data.id,
    method: 'put',
    data
  })
}

// 根据id获取经纪
export function searchAgent(id) {
  return request({
    url: '/agents/' + id
  })
}

// 删除经纪
export function delAgent(id) {
  return request({
    url: '/agents/' + id,
    method: 'delete'
  })
}
